import urllib.request as request

url="https://www.baidu.com"

headers={
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36"
}

req=request.Request(url=url,headers=headers)

response=request.urlopen(req)
content=response.read().decode("utf-8")
print(content)